/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.apache.info.service.plugins  
 */
package com.apache.info.service.plugins;

import com.apache.api.vo.ParamsVo;
import com.apache.cache.util.Validator;

/**
 * description:  主子表修改操作
 * @author dwusoft 创建时间：2015-10-15  
 * @Copyright(c)2014:北京--软件技术有限公司
 */
public class SubUpdateInfoPluginImpl extends AbstractSubInfoPlugin {

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see com.apache.info.service.plugins.AbstractSubInfoPlugin#doInvoke(com.apache.api.vo.ParamsVo)  
	 */
	protected Object doInvoke(ParamsVo vo) {
		String mark = "false";
		if (Validator.isNull(String.valueOf(vo.getParams("dyncSql")))) {//直接执行sql查询
			String sql = this.getDynicSql(vo, 2, String.valueOf(vo.getParams("mainSortCode")),
					String.valueOf(vo.getParams("mainTableName")));
			String subSql = this.getDynicSql(vo, 2, String.valueOf(vo.getParams("subSortCode")),
					String.valueOf(vo.getParams("subTableName")));
			if (Validator.isNotNull(sql)) {
				vo.setParams("dyncSql", sql);
				if (Validator.isNotNull(subSql)) {
					vo.setParams("subDyncSql", subSql);
				}
			} else {
				if (Validator.isNotNull(subSql)) {
					vo.setParams("dyncSql", subSql);
				} else {
					return "true";
				}
			}
		}
		mark = String.valueOf(InfoReleaseManager.editInfo(vo));
		return mark;
	}

}
